/**
 * Created by jinhongglin on 15-11-23.
 */

function judge_text_contain_value(){
    var length = localStorage.length;
    if(length>3){
        document.getElementById("confirm").disabled = false;
    }
    else{
        document.getElementById("confirm").disabled = true;
    }
}
function judge_restaurant(){
    var contain = localStorage.getItem("restaurant_name")
    console.log(contain)
    if(contain == null)
    {
        document.getElementById("choose_button").disabled = true;
    }else{
        document.getElementById("choose_button").disabled = false;
    }
}
function replace(value){
    return value;
}
function unique(data){
    data = data || [];
    var a = {};
    for (var i=0; i<data.length; i++) {
        var v = data[i];
        if (typeof(a[v]) == 'undefined'){
            a[v] = 1;
        }
    };
    data.length=0;
    for (var i in a){
        data[data.length] = i;
    }
    return data;
}
function doReset() {
    for (i = 0; i < document.getElementsByTagName("input").length; i++) {
        if (document.getElementsByTagName("input")[i].type == "text") {
            console.log(document.getElementsByTagName("input")[i].value)
            document.getElementsByTagName("input")[i].value = "";

        }
    }
}
function judge_contain(value){
    var total_information;
    if( value== null){
        total_information= [];

    }else if(value != null) {

        total_information = JSON.parse(value)

    }
    return total_information
}
